<template>
  <v-scale-screen
    :delay="0"
    :box-style="{
      backgroundColor: '#051735',
    }"
  >
    <el-carousel
      v-if="!virtualShow"
      trigger="click"
      height="1080px"
      :interval="interval * 1000"
      indicator-position="none"
      :arrow="arrow"
      @change="changeScene"
    >
      <el-carousel-item v-for="item in 6" :key="item">
        <Trend-chart
          v-if="item == 1"
          title="威士凯数智化车间 全厂药水化验 白班"
          c-id1="day-film"
          row-title1="OSP槽<span style='color:#ffe500'>膜厚</span>趋势图"
          :x-list1="xList1"
          :y-list1="yList1Day"
          c-id2="day-cu2+"
          row-title2="微蚀槽<span style='color:#ffe500'>CU2+</span>趋势图"
          :x-list2="xList2"
          :y-list2="yList2Day"
          c-id3="day-weight"
          row-title3="蚀刻槽<span style='color:#ffe500'>比重</span>趋势图"
          :x-list3="xList3"
          :y-list3="yList3Day"
        />
        <Trend-chart
          v-if="item == 2"
          title="威士凯数智化车间 全厂药水化验 夜班"
          c-id1="night-film"
          row-title1="OSP槽<span style='color:#ffe500'>膜厚</span>趋势图"
          :x-list1="xList1"
          :y-list1="yList1Night"
          c-id2="night-cu2+"
          row-title2="微蚀槽<span style='color:#ffe500'>CU2+</span>趋势图"
          :x-list2="xList2"
          :y-list2="yList2Night"
          c-id3="night-weight"
          row-title3="蚀刻槽<span style='color:#ffe500'>比重</span>趋势图"
          :x-list3="xList3"
          :y-list3="yList3Night"
        />
        <Trend-chart
          v-if="item == 3"
          title="威士凯数智化车间 全厂药水化验 白班"
          c-id1="day-rate"
          row-title1="除胶槽<span style='color:#ffe500'>除胶速率</span>趋势图"
          :x-list1="xList4"
          :y-list1="yList4Day"
          c-id2="day-desmear"
          row-title2="微蚀槽<span style='color:#ffe500'>微蚀速率</span>趋势图"
          :x-list2="xList5"
          :y-list2="yList5Day"
          c-id3="day-copper"
          row-title3="化学铜<span style='color:#ffe500'>沉积速率</span>趋势图"
          :x-list3="xList6"
          :y-list3="yList6Day"
        />
        <Trend-chart
          v-if="item == 4"
          title="威士凯数智化车间 全厂药水化验 夜班"
          c-id1="night-rate"
          row-title1="除胶槽<span style='color:#ffe500'>除胶速率</span>趋势图"
          :x-list1="xList4"
          :y-list1="yList4Night"
          c-id2="night-desmear"
          row-title2="微蚀槽<span style='color:#ffe500'>微蚀速率</span>趋势图"
          :x-list2="xList5"
          :y-list2="yList5Night"
          c-id3="night-copper"
          row-title3="化学铜<span style='color:#ffe500'>沉积速率</span>趋势图"
          :x-list3="xList6"
          :y-list3="yList6Night"
        />
        <Develop-rate
          v-if="item == 5"
          title="威士凯数智化车间 全厂药水化验"
          :data1="fristCheck"
          :data2="secondCheck"
          :data3="OSPData"
          :data4="lineData"
          :data5="solderMaskData"
          :data6="etchData"
          :data7="cleanData"
          :data8="linePreData"
          :data9="solderPreData"
        />
        <P-t-h
          v-if="item == 6"
          title="威士凯数智化车间 全厂药水化验"
          :data1="PTHData"
          :data2="PTHSecondData"
          :data3="platingData"
        />
      </el-carousel-item>
    </el-carousel>
    <el-carousel
      v-if="virtualShow"
      trigger="click"
      height="1080px"
      :interval="interval * 1000"
      indicator-position="none"
      :arrow="arrow"
    >
      <el-carousel-item v-for="(i, k) in virtualList" :key="k">
        <Time-func />
        <img :src="i" style="width: 100%; height: 100%" />
      </el-carousel-item>
    </el-carousel>
  </v-scale-screen>
</template>
<script>
import { mapState } from "vuex";
import TrendChart from "@/views/srceen/workshop/cp/TrendChart.vue"; //药水检验
import DevelopRate from "@/views/srceen/workshop/cp/DevelopRate.vue"; //药水比率
import PTH from "@/views/srceen/workshop/cp/PTH.vue"; //药水数据
import {
  getThicknessTrend,
  getUC2Trend,
  getProportionTrend,
  getGelRemovalRateTrend,
  getCorrosionRateTrend,
  getDepositionRateTrend,
  getFirstInspectionPassRate,
  getSecondaryInspectionPassRate,
  getOSP_Rate,
  getEtchingSolutionRate,
  getLineRate,
  getSolderMaskRate,
  getCleaningLineRate,
  getLinePreProcessingRate,
  getSolderMaskPreProcessingRate,
  getPTH_Rate,
  getPTH_SecondaryRate,
  getPlatingRate,
  getVirtualTurn,
  getVirtualDataById,
} from "@/api/srceen/workshop";
export default {
  components: {
    TrendChart,
    DevelopRate,
    PTH,
  },
  data() {
    return {
      virtualShow: false, // 显示虚拟数据
      virtualList: [], // 虚拟数据
      xList1: [], // 膜厚x轴
      xList2: [], // UC2+x轴
      xList3: [], // 比重x轴
      xList4: [], // 除胶速率x轴
      xList5: [], // 微蚀速率x轴
      xList6: [], // 沉积速率x轴
      // 第一屏 白班
      yList1Day: [], // 膜厚y轴
      yList2Day: [], // UC2+y轴
      yList3Day: [], // 比重y轴
      // 夜班
      yList1Night: [], // 膜厚y轴
      yList2Night: [], // UC2+y轴
      yList3Night: [], // 比重y轴
      // 第二屏 白班
      yList4Day: [], // 除胶速率y轴
      yList5Day: [], // 微蚀速率y轴
      yList6Day: [], // 沉积速率y轴
      // 夜班
      yList4Night: [], // 除胶速率y轴
      yList5Night: [], // 微蚀速率y轴
      yList6Night: [], // 沉积速率y轴
      // 第三屏
      fristCheck: {
        id: "one-pass-rate",
        title: "一次检测合格率",
        xlist: [],
        data: [],
      },
      secondCheck: {
        id: "two-pass-rate",
        title: "二次检测合格率",
        xlist: [],
        data: [],
      },
      OSPData: {
        title: "OSP",
        data: [],
      },
      lineData: {
        title: "线路显影",
        data: [],
      },
      solderMaskData: {
        title: "防焊显影",
        data: [],
      },
      etchData: {
        title: "蚀刻药水",
        data: [],
      },
      cleanData: {
        title: "成品清洗线",
        data: [],
      },
      linePreData: {
        title: "线路前处理",
        data: [],
      },
      solderPreData: {
        title: "防焊前处理",
        data: [],
      },
      // 第四屏
      PTHData: {
        title: "沉铜-PTH",
        data: [],
      },
      PTHSecondData: {
        title: "沉铜-PTH二次化验",
        data: [],
      },
      platingData: {
        title: "电镀",
        data: [],
      },
    };
  },
  computed: {
    ...mapState({
      interval: (state) => state.app.workshopDelay,
      arrow: (state) => state.app.workshopArrow,
    }),
  },
  mounted() {
    this.checkVirtual();
  },
  methods: {
    // 检测是否是虚拟数据
    checkVirtual() {
      getVirtualTurn().then((res) => {
        this.virtualShow = res.data;
        if (res.data) {
          this.getVirtualData();
        } else {
          this.changeScene(0);
        }
      });
    },
    // 切换大屏
    changeScene(e) {
      if (e === 0 || e === 1) {
        this.getTrendChart();
      } else if (e === 2 || e === 3) {
        this.getTrendChart2();
      } else if (e === 4) {
        this.getDevelopRate();
      } else if (e === 5) {
        this.getPTHRate();
      }
    },
    // 获取第一屏趋势图信息
    getTrendChart() {
      getThicknessTrend("assay").then((res) => {
        if (res.data) {
          const {
            xaxis,
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue,
            nightShiftAnalysisValue,
          } = res.data;
          this.xList1 = xaxis || [];
          this.yList1Day = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue
          );
          this.yList1Night = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            nightShiftAnalysisValue
          );
        }
      });

      getUC2Trend("assay").then((res) => {
        if (res.data) {
          const {
            xaxis,
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue,
            nightShiftAnalysisValue,
          } = res.data;
          this.xList2 = xaxis || [];
          this.yList2Day = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue
          );
          this.yList2Night = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            nightShiftAnalysisValue
          );
        }
      });

      getProportionTrend("assay").then((res) => {
        if (res.data) {
          const {
            xaxis,
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue,
            nightShiftAnalysisValue,
          } = res.data;
          this.xList3 = xaxis || [];
          this.yList3Day = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue
          );
          this.yList3Night = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            nightShiftAnalysisValue
          );
        }
      });
    },
    // 获取第二屏趋势图信息
    getTrendChart2() {
      getGelRemovalRateTrend("assay").then((res) => {
        if (res.data) {
          const {
            xaxis,
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue,
            nightShiftAnalysisValue,
          } = res.data;
          this.xList4 = xaxis || [];
          this.yList4Day = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue
          );
          this.yList4Night = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            nightShiftAnalysisValue
          );
        }
      });

      getCorrosionRateTrend("assay").then((res) => {
        if (res.data) {
          const {
            xaxis,
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue,
            nightShiftAnalysisValue,
          } = res.data;
          this.xList5 = xaxis || [];
          this.yList5Day = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue
          );
          this.yList5Night = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            nightShiftAnalysisValue
          );
        }
      });

      getDepositionRateTrend("assay").then((res) => {
        if (res.data) {
          const {
            xaxis,
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue,
            nightShiftAnalysisValue,
          } = res.data;
          this.xList6 = xaxis || [];
          this.yList6Day = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            dayShiftAnalysisValue
          );
          this.yList6Night = this.getYList(
            specsMin,
            specsMax,
            controlMin,
            controlMax,
            nightShiftAnalysisValue
          );
        }
      });
    },
    // 获取药水比率信息
    getDevelopRate() {
      getFirstInspectionPassRate("assay").then((res) => {
        if (res.data) {
          this.fristCheck.data = [
            {
              data: res.data.actual || [],
              name: "合格率",
              showSymbol: false,
            },
            {
              data: res.data.target || [],
              name: "目标",
              showSymbol: false,
            },
            {
              data: res.data.actual || [],
              name: "",
              showSymbol: true,
            },
          ];
        }
      });

      getSecondaryInspectionPassRate("assay").then((res) => {
        if (res.data) {
          this.secondCheck.data = [
            {
              data: res.data.actual || [],
              name: "合格率",
              showSymbol: false,
            },
            {
              data: res.data.target || [],
              name: "目标",
              showSymbol: false,
            },
            {
              data: res.data.actual || [],
              name: "",
              showSymbol: true,
            },
          ];
        }
      });

      getOSP_Rate("assay").then((res) => {
        if (res.data) {
          this.OSPData.data = res.data;
        } else {
          this.OSPData.data = [
            {
              name: "硫酸",
              scale: "4-6%",
              range: "",
              value: "5.6",
            },
            {
              name: "硫酸",
              scale: "0.4-0.8N",
              range: "",
              value: "0.77",
            },
            {
              name: "硫酸",
              scale: "2-4%",
              range: "",
              value: "2.744",
            },
            {
              name: "SPS",
              scale: "10-20g/L",
              range: "",
              value: "11.4",
            },
            {
              name: "CU2+",
              scale: "≤10g/L",
              range: "",
              value: "1.5875",
            },
            {
              name: "硫酸",
              scale: "2-4%",
              range: "",
              value: "3.136",
            },
            {
              name: "硫酸亚锡",
              scale: "20-40g/L",
              range: "",
              value: "27.387",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "13.272",
            },
            {
              name: "硫酸亚锡",
              scale: "20-40g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "10.808",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "68.75",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.97",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "42.6",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "66.25",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "10.64",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "56.8",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "67.5",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.97",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "52.54",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "70",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.039",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "56.8",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "62.5",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.438",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "51.12",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "68.75",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.305",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "56.8",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "62.5",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.039",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "42.6",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.039",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.039",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.438",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "12.502",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "12.236",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "13.034",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
          ];
        }
      });

      getEtchingSolutionRate("assay").then((res) => {
        if (res.data) {
          this.etchData = res.data;
        } else {
          this.etchData.data = [
            {
              name: "氢氧化钠",
              scale: "2-4%",
              range: "",
              value: "",
            },
            {
              name: "氢氧化钠",
              scale: "2-4%",
              range: "",
              value: "",
            },
            {
              name: "氢氧化钠",
              scale: "2-4%",
              range: "",
              value: "",
            },
            {
              name: "氯离子",
              scale: "180-200g/L",
              range: "",
              value: "",
            },
            {
              name: "铜含量",
              scale: "110-140g/L",
              range: "",
              value: "",
            },
            {
              name: "比重",
              scale: "1-1.5",
              range: "",
              value: "",
            },
            {
              name: "PH值",
              scale: "7-9",
              range: "",
              value: "",
            },
            {
              name: "酸当量",
              scale: "4-7N",
              range: "",
              value: "",
            },
            {
              name: "比重",
              scale: "≤35",
              range: "",
              value: "",
            },
          ];
        }
      });

      getLineRate("assay").then((res) => {
        if (res.data) {
          this.lineData.data = res.data;
        } else {
          this.lineData.data = [
            {
              name: "碳酸钠",
              scale: "0.8-1.2%",
              range: "",
              value: "",
            },
            {
              name: "碳酸钠",
              scale: "0.8-1.2%",
              range: "",
              value: "",
            },
          ];
        }
      });

      getSolderMaskRate("assay").then((res) => {
        if (res.data) {
          this.solderMaskData = res.data;
        } else {
          this.solderMaskData.data = [
            {
              name: "显影液",
              scale: "0.8-1.2%",
              range: "",
              value: "",
            },
            {
              name: "显影液",
              scale: "0.8-1.2%",
              range: "",
              value: "",
            },
          ];
        }
      });

      getCleaningLineRate("assay").then((res) => {
        if (res.data) {
          this.cleanData = res.data;
        } else {
          this.cleanData.data = [
            {
              name: "硫酸",
              scale: "3-5%",
              range: "",
              value: "",
            },
          ];
        }
      });

      getLinePreProcessingRate("assay").then((res) => {
        if (res.data) {
          this.linePreData = res.data;
        } else {
          this.linePreData.data = [
            {
              name: "硫酸",
              scale: "3-5%",
              range: "",
              value: "",
            },
          ];
        }
      });

      getSolderMaskPreProcessingRate("assay").then((res) => {
        if (res.data) {
          this.solderPreData = res.data;
        } else {
          this.solderPreData.data = [
            {
              name: "硫酸",
              scale: "3-5%",
              range: "",
              value: "",
            },
          ];
        }
      });
    },
    // 获取药水数据信息
    getPTHRate() {
      getPTH_Rate("assay").then((res) => {
        if (res.data) {
          this.PTHData.data = res.data;
        } else {
          this.PTHData.data = [
            {
              name: "碱度",
              scale: "0.9-1.1N",
              range: "0.95-1.05N",
            },
            {
              name: "锰酸根",
              scale: "＜25g/L",
              range: "＜25g/L",
            },
            {
              name: "高锰酸钾",
              scale: "40-60g/L",
              range: "45-55g/L",
            },
            {
              name: "除胶速率",
              scale: "0.15-0.3mg/cm",
              range: "0.19-0.26mg/cm",
            },
            {
              name: "七价锰",
              scale: "40-60g/L",
              range: "45-55g/L",
            },
            {
              name: "除胶速率",
              scale: "0.15 -0.30mg/cm²",
              range: "0.185-0.265mg/cm²",
            },
            {
              name: "H2SO4",
              scale: "1-3%",
              range: "1.5-2.5%",
            },
            {
              name: "H2O2",
              scale: "1-3%",
              range: "1.5-2.5%",
            },
            {
              name: "硫酸",
              scale: "1-1.5N",
              range: "1.25-1.45N",
            },
            {
              name: "碱度",
              scale: "0.15-0.25N",
              range: "0.175-0.215N",
            },
            {
              name: "强度",
              scale: "20-40%",
              range: "25-35%",
            },
            {
              name: "碱单量",
              scale: "0.1-0.25",
              range: "0.125-0.225",
            },
            {
              name: "SPS",
              scale: "60-100g/L",
              range: "70-90g/L",
            },
            {
              name: "硫酸",
              scale: "3-5%",
              range: "3.5-4.5%",
            },
            //
            {
              name: "CU2+",
              scale: "<25g/L",
              range: "<25g/L",
            },
            {
              name: "微蚀速率",
              scale: "1-2um",
              range: "1.25-1.75um",
            },
            {
              name: "微蚀速率",
              scale: "40-80U〞",
              range: "50-70U〞",
            },
            {
              name: "比重",
              scale: "10-16Be",
              range: "12-15Be",
            },
            {
              name: "酸度",
              scale: "0.5-0.7N",
              range: "0.55-0.65N",
            },
            {
              name: "比重",
              scale: "10-16Be",
              range: "12-15Be",
            },
            {
              name: "酸度",
              scale: "0.7-0.9N",
              range: "0.75-0.85N",
            },
            {
              name: "比色",
              scale: "60-100%",
              range: "70-90%",
            },
            {
              name: "酸度",
              scale: "8-12N",
              range: "9-11N",
            },
            {
              name: "PH",
              scale: "8.2-9.2",
              range: "8.5-8.9",
            },
            {
              name: "HCHO（甲醛）1",
              scale: "3-7 g/L",
              range: "4-6g/L",
            },
            {
              name: "HCHO（甲醛）2",
              scale: "3-7 g/L",
              range: "4-6g/L",
            },
            {
              name: "氢氧化钠1",
              scale: "8-12g/L",
              range: "9-11g/L",
            },
            {
              name: "氢氧化钠2",
              scale: "8-12g/L",
              range: "9-11g/L",
            },
            {
              name: "CU2+  1槽",
              scale: "1.0-2.0g/L",
              range: "1.25-1.75g/L",
            },
            {
              name: "CU2+  2槽",
              scale: "1.0-2.0g/L",
              range: "1.25-1.75g/L",
            },
            {
              name: "沉积速率",
              scale: "35-55uin",
              range: "39.5-45.5uin",
            },
          ];
        }
      });

      getPTH_SecondaryRate("assay").then((res) => {
        if (res.data) {
          this.PTHSecondData.data = res.data;
        } else {
          this.PTHSecondData.data = [
            {
              name: "SPS",
              scale: "40-60g/L",
              range: "45-55g/L",
              value: "",
            },
            {
              name: "硫酸",
              scale: "2-4%",
              range: "3.5-4.5%",
              value: "",
            },
            {
              name: "cu2+",
              scale: "<25g/L",
              range: "<25g/L",
              value: "",
            },
            {
              name: "HCHO",
              scale: "3-7 g/L",
              range: "4-6g/L",
              value: "3.42",
            },
            {
              name: "氢氧化钠",
              scale: "8-12g/L",
              range: "9-11g/L",
              value: "12.72",
            },
            {
              name: "CU2+",
              scale: "1.0-2.0g/L",
              range: "1.25-1.75g/L",
              value: "1.49",
            },
            {
              name: "HCHO",
              scale: "3-7 g/L",
              range: "4-6g/L",
              value: "4.5",
            },
            {
              name: "氢氧化钠",
              scale: "8-12g/L",
              range: "9-11g/L",
              value: "10.16",
            },
            {
              name: "CU2+",
              scale: "1.0-2.0g/L",
              range: "1.25-1.75g/L",
              value: "1.75",
            },
          ];
        }
      });

      getPlatingRate("assay").then((res) => {
        if (res.data) {
          this.platingData.data = res.data;
        } else {
          this.platingData.data = [
            {
              name: "硫酸",
              scale: "4-6%",
              range: "",
              value: "5.6",
            },
            {
              name: "硫酸",
              scale: "0.4-0.8N",
              range: "",
              value: "0.77",
            },
            {
              name: "硫酸",
              scale: "2-4%",
              range: "",
              value: "2.744",
            },
            {
              name: "SPS",
              scale: "10-20g/L",
              range: "",
              value: "11.4",
            },
            {
              name: "CU2+",
              scale: "≤10g/L",
              range: "",
              value: "1.5875",
            },
            {
              name: "硫酸",
              scale: "2-4%",
              range: "",
              value: "3.136",
            },
            {
              name: "硫酸亚锡",
              scale: "20-40g/L",
              range: "",
              value: "27.387",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "13.272",
            },
            {
              name: "硫酸亚锡",
              scale: "20-40g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "10.808",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "68.75",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.97",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "42.6",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "66.25",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "10.64",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "56.8",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "67.5",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.97",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "52.54",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "70",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.039",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "56.8",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "62.5",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.438",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "51.12",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "68.75",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.305",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "56.8",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "62.5",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.039",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "42.6",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.039",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.039",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "11.438",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "12.502",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "12.236",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
            {
              name: "硫酸铜",
              scale: "50-70g/L",
              range: "",
              value: "",
            },
            {
              name: "硫酸",
              scale: "10-14%",
              range: "",
              value: "13.034",
            },
            {
              name: "氯离子",
              scale: "40-80PPM",
              range: "",
              value: "",
            },
          ];
        }
      });
    },
    // 获取取值范围
    getRange(minList, maxList) {
      let min = minList ? minList[0] : null;
      let max = maxList ? maxList[0] : null;
      if (min && max) {
        return min + "-" + max;
      } else if (min) {
        return min;
      } else if (max) {
        return max;
      } else {
        return "";
      }
    },
    // 获取图表数据
    getYList(specsMin, specsMax, controlMin, controlMax, value) {
      let specsName = this.getRange(specsMin, specsMax);
      let controlName = this.getRange(controlMin, controlMax);
      return [
        {
          data: specsMax || [],
          name: `规格范围（${specsName}μm）`,
          area: false,
        },
        {
          data: specsMin || [],
          name: `规格范围（${specsName}μm）`,
          area: false,
        },
        {
          data: controlMax || [],
          name: `管控范围（${controlName}μm）`,
          area: false,
        },
        {
          data: controlMin || [],
          name: `管控范围（${controlName}μm）`,
          area: false,
        },
        {
          data: value || [],
          name: "分析值",
          area: true,
          showSymbol: true,
        },
      ];
    },
    // 获取虚拟数据图片
    getVirtualData() {
      getVirtualDataById({ id: "ASSAY" }).then((res) => {
        if (res.data) {
          let imgs = res.data.imgUrl || "";
          this.virtualList = imgs.split(",");
        }
      });
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep .el-carousel__arrow {
  background-color: rgba(0, 119, 255, 0.1);
}
</style>
